<?php
/**
 * https://gitee.com/Mao02
 * http://www.dazhetu.cn/
 * jay_fun 410136330@qq.com
 * Date: 2018/11/21
 * Time: 14:09
 */

namespace app\common\middleware;

use think\facade\Config;

/**
 * 网站维护中间件
 * Class MaintenanceCheck
 * @package app\common\middleware
 */
class MaintenanceCheck
{
    public function handle($request, \Closure $next){
        if (Config::get('maintenance')){
            abort(503,'站点维护中');
        }
        return $next($request);
    }
}